package cn.broadsense.biz.domain;

import cn.broadsense.biz.dto.Channel3dDataDto;
import cn.broadsense.biz.handler.Channel3dDataHandler;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 采集任务点位列表
 *
 * @author bs
 * @TableName t_collect_data_task_channel
 */
@TableName(value = "t_collect_data_task_channel")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel("采集任务点位数据")
public class CollectDataTaskChannel implements Serializable {
    private static final long serialVersionUID = -3971910756314880451L;
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty("id")
    private Long id;

    /**
     * 任务id
     */
    @ApiModelProperty("任务id")
    private Long collectDataTaskId;

    /**
     * 点位id
     */
    @ApiModelProperty("点位id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long channelId;

    /**
     * 点位编码
     */
    @ApiModelProperty("点位编码")
    private String channelSn;

    /**
     * 点位名称
     */
    @ApiModelProperty("点位名称")
    private String channelName;

    /**
     * 审核状态 0=初始状态 1=通过 2=驳回
     */
    @ApiModelProperty("审核状态 0=初始状态 1=通过 2=驳回 3=已提交")
    private Integer status;

    /**
     * 点位采集的信息json,与channel_3d_data表数据保持一致
     */
    @ApiModelProperty("点位采集的信息json")
    @TableField(typeHandler = Channel3dDataHandler.class)
    private Channel3dDataDto collectData;

    @ApiModelProperty("点位信息")
    @TableField(exist = false)
    private Channel channel;


    /**
     * 更新时间
     */
    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty("父类组织编码")
    @TableField(exist = false)
    private String parentOrgCode;
    
}